<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>bformenc</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="DeprecatedTop.html" title="Deprecated Orchestra Opcodes and GEN Routines" />
    <link rel="prev" href="bformdec.html" title="bformdec" />
    <link rel="next" href="clock.html" title="clock" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">bformenc</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="bformdec.html">Prev</a> </td>
          <th width="60%" align="center">Deprecated Orchestra Opcodes and GEN Routines</th>
          <td width="20%" align="right"> <a accesskey="n" href="clock.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="bformenc"></a>
      <div class="titlepage"></div>
      <a id="IndexBformenc" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">bformenc</span>
        </h2>
        <p>bformenc — 
      Deprecated. Codes a signal into the ambisonic B format.
     </p>
      </div>
      <div class="refsect1">
        <a id="idp219379168"></a>
        <h2>Description</h2>
        <p>
      Codes a signal into the ambisonic B format. Note that this opcode is
      deprecated as it is inaccurate, and is replaced by the much
      better
      opcode <a class="link" href="bformenc1.html" title="bformenc1"><em class="citetitle">bformenc1</em></a>
      which replicates all the important features; also note that the
      gain arguments are not available in <span class="emphasis"><em>bformenc1</em></span>.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp219382000"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">aw, ax, ay, az <span class="command"><strong>bformenc</strong></span> asig, kalpha, kbeta, kord0, kord1</pre>
        <pre class="synopsis">aw, ax, ay, az, ar, as, at, au, av <span class="command"><strong>bformenc</strong></span> asig, kalpha, kbeta, \
      kord0, kord1 , kord2</pre>
        <pre class="synopsis">aw, ax, ay, az, ar, as, at, au, av, ak, al, am, an, ao, ap, aq <span class="command"><strong>bformenc</strong></span> \
      asig, kalpha, kbeta, kord0, kord1, kord2, kord3</pre>
      </div>
      <div class="refsect1">
        <a id="idp219461840"></a>
        <h2>Performance</h2>
        <p>
	<span class="emphasis"><em>aw, ax, ay, ... </em></span>
	-- output cells of the B format.
	</p>
        <p>
	<span class="emphasis"><em>asig</em></span> -- input signal.
	</p>
        <p>
	<span class="emphasis"><em>kalpha</em></span> –- azimuth angle in degrees (clockwise).
	</p>
        <p>
	<span class="emphasis"><em>kbeta</em></span> -- altitude angle in degrees.
        </p>
        <p>
	<span class="emphasis"><em>kord0</em></span> -- linear gain of the zero order B format.
	</p>
        <p>
	<span class="emphasis"><em>kord1</em></span> -- linear gain of the first order B format.
	</p>
        <p>
	<span class="emphasis"><em>kord2</em></span> -- linear gain of the second order B format.
	</p>
        <p>
	<span class="emphasis"><em>kord3</em></span> -- linear gain of the third order B format.
	</p>
      </div>
      <div class="refsect1">
        <a id="idp219469536"></a>
        <h2>Example</h2>
        <p>
      Here is an example of the bformenc opcode. It uses the file <a class="ulink" href="examples/bformenc.csd" target="_top"><em class="citetitle">bformenc.csd</em></a>.

    </p>
        <div class="example">
          <a id="idp219471312"></a>
          <p class="title">
            <strong>Example 1139. Example of the bformenc opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
<span class="comment">; Audio out   Audio in    No messages</span>
<span class="comment">;-odac           -iadc     -d     ;;;RT audio I/O</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
 -o bformenc.wav -W <span class="comment">;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>
<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">kr</span> <span class="op">=</span> 4410
<span class="ohdr">ksmps</span> <span class="op">=</span> 10
<span class="ohdr">nchnls</span> <span class="op">=</span> 8

<span class="comment">;bformenc is deprecated, please use bformenc1</span>

<span class="oblock">instr</span> 1
        <span class="comment">; generate pink noise</span>
        anoise <span class="opc">pinkish</span> 1000
        
        <span class="comment">; two full turns</span>
        kalpha <span class="opc">line</span> 0, p3, 720
        kbeta <span class="op">=</span> 0
        
        <span class="comment">; fade ambisonic order from 2nd to 0th during second turn</span>
        kord0 <span class="op">=</span> 1
        kord1 <span class="opc">linseg</span> 1, p3 <span class="op">/</span> 2, 1, p3 <span class="op">/</span> 2, 0
        kord2 <span class="opc">linseg</span> 1, p3 <span class="op">/</span> 2, 1, p3 <span class="op">/</span> 2, 0
        
        <span class="comment">; generate B format</span>
        aw, ax, ay, az, ar, as, at, au, av <span class="opc">bformenc</span> anoise, kalpha, kbeta, kord0, kord1, kord2
        
        <span class="comment">; decode B format for 8 channel circle loudspeaker setup</span>
        a1, a2, a3, a4, a5, a6, a7, a8 <span class="opc">bformdec</span> 4, aw, ax, ay, az, ar, as, at, au, av
        
        <span class="comment">; write audio out</span>
        <span class="opc">outo</span> a1, a2, a3, a4, a5, a6, a7, a8
<span class="oblock">endin</span>

<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="comment">; Play Instrument #1 for 20 seconds.</span>
<span class="stamnt">i</span> 1 0 20
<span class="stamnt">e</span>


<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp219475600"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Samuel Groner</td>
          </tr>
          <tr>
            <td>2005</td>
          </tr>
        </table>
        <p>
    </p>
        <p>New in version 5.07. Deprecated in 5.09.</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="bformdec.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="DeprecatedTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="clock.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">bformdec </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> clock</td>
        </tr>
      </table>
    </div>
  </body>
</html>
